reversing a range of numbers using for loop